/**
 * 
 */
package com.study.dao;

import java.util.List;

import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.One;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.mapping.FetchType;

import com.study.entity.Classes;
import com.study.entity.GatewayHandlerEntity;

/**
 * 关联查询
 * @author Administrator
 * @date 2019年5月14日
 */
public interface IClasses {

	//通过注解实现mapper
	@Select("select * from class where c_id = #{id}")
	@Results({
		@Result(id=true,column="c_id",property="id"),
        @Result(column="c_name",property="name"),
        @Result(column="teacher_id",property="teacher",one=@One(select="com.study.dao.ITeacher.getTeacher",fetchType= FetchType.EAGER)),
		@Result(column="c_id",property="students",many=@Many(select="com.study.dao.IStudent.getStudent",fetchType= FetchType.EAGER))
	})
	public Classes getClass3(int id);
	

}
